/**
 * Created by MADinow on 26.10.2014.
 */

/* -----------------------------------------------------------
         PAGE DIMMER UI MODULE
 ----------------------------------------------------------- */

define(['settings/variables', 'ui/madGenerator', 'jquery', 'jquery_ui'],
    function (Variables, Genny) {

        var _pageDimmer = null ;

        /**
         * getter for page dimmer
         * @returns page dimmer
         * @private
         */
        function _getPageDimmer(){
            return _pageDimmer;
        }

        /**
         * initializes the page dimmer
         * @param targetDom
         * @private
         */
        function _initPageDimmer(targetDom){
            _pageDimmer = Genny.createDiv(targetDom, 'page-dimmer', 'container-absolute page', true);
        }

        /**
         * blurs the whole screen by activating the page dimmer
         */
        function _blurScreen(){
            _pageDimmer.fadeIn("slow");
        }

        /**
         * clarifies the whole screen by deactivating the page dimmer
         */
        function _clarifyScreen(){
            _pageDimmer.fadeOut("slow");
        }


        /**
         * public interface
         */
        return {

            /* variables */
            getPageDimmer: _getPageDimmer,

            /* functions */
            initPageDimmer: _initPageDimmer,
            blurScreen: _blurScreen,
            clarifyScreen: _clarifyScreen
        }



    }
);